package com.miyake.client.community;

import com.google.gwt.user.client.rpc.AsyncCallback;
import com.google.gwt.user.client.ui.VerticalPanel;
import com.miyake.client.DataService;
import com.miyake.client.DataServiceAsync;
import com.miyake.client.datamanage.DataViewer;
import com.miyake.client.datamanage.NodeProperty;

public class ShowPaper {
	private DataServiceAsync service = DataService.Util.getInstance();

	public ShowPaper(String key, final VerticalPanel verticalPanel) {
		service.getNode(key, new AsyncCallback<NodeProperty>() {

			@Override
			public void onFailure(Throwable caught) {
				// TODO Auto-generated method stub
				
			}

			@Override
			public void onSuccess(NodeProperty result) {
				DataViewer viewer = new DataViewer();
				viewer.setWidth("100%");
				viewer.setSelectedNode(result);
				verticalPanel.add(viewer);
			}
			
		});
	}

}
